package model;

/**
 * Represent the basic parameter common for preprocessor and solver.
 * 
 * @author GRONOWSKI Stephane svan001@aol.com
 *        <p>
 *         igsat 2010
 *        </p>
 */
public class BasicParameter {
	/** default delay for timeout in millisecond */
	public static final int	DEFAULT_DELAY	= 600 * 1000;
	/** delay minimal for timeout in millisecond */
	public static final int	MIN_DELAY		= 1000;
	/** no delay value for timeout */
	public static final int	NO_DELAY		= -4;

	/** time in millisecond before the timeout will be over */
	protected int			timeOut			= DEFAULT_DELAY;

	/**
	 * @return the tiemout
	 */
	public int getTimeOut() {
		return timeOut;
	}

	/**
	 * change the timeout parameter
	 * 
	 * @param timeOut
	 *            the timeout
	 */
	public void setTimeOut(int timeOut) {
		// if(timeOut != BasicParameter.NO_DELAY && timeOut <
		// BasicParameter.MIN_DELAY)
		// return false;

		this.timeOut = timeOut;
		// return true;
	}

	/**
	 * 
	 * @return if there is a ness for a timeout != NO_DELAY
	 */
	public boolean needTimeOut() {
		if (timeOut == NO_DELAY)
			return false;
		else
			return true;

	}

	/**
	 * Create a instance of basic parameter.
	 */
	public BasicParameter() {
	}

	/**
	 * check if the parameters respect are coherent : like if the timeout is correct
	 */
	public boolean basicCheck() {
		if (timeOut != NO_DELAY && timeOut < MIN_DELAY)
			return false;

		return true;
	}
}
